function ajaxCall(method,url,callBackFunction,data){
    var httprequest=new XMLHttpRequest();
    httprequest.onreadystatechange=function(){
        if(httprequest.readyState==4&&httprequest.status==200){
            alert(httprequest.responseText);
            callBackFunction(httprequest.responseText);
        }
    }
    httprequest.open(method, url, true);
    httprequest.setRequestHeader("X-Requested-With", "AJAX");
    httprequest.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
    httprequest.send(JSON.stringify(data));
}